<!--<div class="form">-->


<?php
Util::tsRegisterAssetJs('maestro.js');
/** @var NiniosCartaNutricionalController $this */
/** @var NiniosCartaNutricional $model */
/** @var AweActiveForm $form */
$this->menu = array(
//    array('label' => Yii::t('AweCrud.app', 'List') . ' ' . NiniosCartaNutricional::label(2), 'icon' => 'list', 'url' => array('index')),
    array('label' => Yii::t('AweCrud.app', 'Manage') . ' ' . NiniosCartaNutricional::label(), 'icon' => 'plus', 'url' => array('admin')),
);

$form = $this->beginWidget('ext.AweCrud.components.AweActiveForm', array(
    'id' => 'ninios-carta-nutricional-form',
    'enableAjaxValidation' => false,
    'action' => Yii::app()->baseUrl . "/index.php/ninio/niniosCartaNutricional/ajaxCreate",
    'clientOptions' => array('validateOnSubmit' => true, 'validateOnChange' => false,), // valida en el mismo _ajax
    'enableClientValidation' => true,
        ));
?>
<div class="row-fluid sortable span9">
    <div class="box">
        <div class="box-header well" data-original-title>
            <h2>
<!--                <i class="icon-list"></i> -->
                Asignar menú a infantes
            </h2>
            <div class="box-icon">
                <a href="#" class="btn btn-minimize btn-round"><i class="icon-chevron-up"></i> </a> 
            </div>
        </div>

        <div class="box-content">
            <p class="note">
                <?php echo Yii::t('AweCrud.app', 'Fields with') ?> <span class="required">*</span>
                <?php echo Yii::t('AweCrud.app', 'are required') ?>.    </p>

            <?php echo $form->errorSummary($model) ?>
            <div class="span5">
                <?php // echo $form->textField($model, 'fecha',array('value'=>  Util::FechaActual()))  ?>
                <?php echo $form->dropDownListRow($model, 'carta_nutricional_id', array('' => ' -- Seleccione -- ') + CHtml::listData(CartaNutricional::model()->findAll(), 'id', CartaNutricional::representingColumn())) ?>
            </div>
            <div class="span5" >  
                <?php
                $this->widget('ext.selgridview.BootSelGridView', array(
                    'id' => 'niniosCartaNutricional-grid',
                    'type' => 'striped bordered hover advance',
                    'selectableRows' => 2,
                    'dataProvider' => $submodel->search(),
                    'filter' => $submodel,
                    'columns' => array(
                        array(
                            'name' => 'id_cartaNinios',
                            'id' => 'check',
                            'class' => 'CCheckBoxColumn',
                            'value' => '$data->id',
                        ),
                        array(
                            'name' => 'nombres',
                            'header' => 'Nombre',
                            'value' => '$data->nombres',
                        ),
                        array(
                            'name' => 'apellidos',
                            'header' => 'Apellido',
                            'value' => '$data->apellidos',
                        ),
                    ),
                ));
                ?>
            </div>
            <?php // echo $form->dropDownListRow($model, 'ninios_id', array('' => ' -- Seleccione -- ') + CHtml::listData(Ninios::model()->findAll(), 'id', Ninios::representingColumn()))  ?>

            <?php // echo $form->textFieldRow($model, 'fecha')  ?>
            <?php // echo $form->textFieldRow($model, 'observaciones', array('maxlength' => 100))  ?>
            <div class="form-actions span12">
                <?php
                $this->widget('bootstrap.widgets.TbButton', array(
                    'buttonType' => 'submit',
                    'type' => 'primary',
                    'htmlOptions'=>array('onclick' => 'js:obtenerSelectedGrid()'),
                    'label' => $model->isNewRecord ? Yii::t('AweCrud.app', 'Create') : Yii::t('AweCrud.app', 'Save'),
                ));
                ?>
                <?php
                $this->widget('bootstrap.widgets.TbButton', array(
                    //'buttonType'=>'submit',
                    'label' => Yii::t('AweCrud.app', 'Cancel'),
                    'htmlOptions' => array('onclick' => 'javascript:history.go(-1)')
                ));
                ?>
            </div>

            <?php $this->endWidget(); ?>
        </div>
    </div>
</div>
<!--</div>-->